/**
 * Copyright (C), 2020, Y2 T205
 * FileName: MyRedissonConfig
 * Author: Lenovo
 * Date: 2020-05-21 14:47
 * Description:
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */


package com.atguigu.gulimall.product.config;


import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Lenovo
 * @create 2020-05-21
 * @since 1.0.0
 */
@Configuration
public class MyRedissonConfig {

    @Bean(destroyMethod = "shutdown")
     public  RedissonClient redisson() throws IOException{
        Config config=new Config();
//        1.创建配置
        config.useSingleServer().setAddress("redis://192.168.64.132:6379");

        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }

}
